<template>
  <div >
    <a-form-model class="fromModels" ref="withdrawConfigModel"  :model="withdrawConfigFroms" layout="vertical" 
    :labelCol="{span: 8}" :wrapperCol="{span: 16}">
        <a-form-model-item label="利率" :rules ="[
          {required: true, message: '请输入利率', trigger: 'blur'}
        ]">
          <a-input v-model="withdrawConfigFroms.fee"  placeholder="请输入利率" />
        </a-form-model-item>
        <a-form-model-item label="笔数费" :rules ="[
          {required: true, message: '请输入笔数费', trigger: 'blur'}
        ]">
          <a-input v-model="withdrawConfigFroms.bsf"  placeholder="请输入笔数费" />
        </a-form-model-item>
        <a-form-model-item label="最低提现金额">
          <a-input v-model="withdrawConfigFroms.min"  placeholder="请输入最低提现金额" />
        </a-form-model-item>
        <a-form-model-item label="提交时间">
          <a-time-picker v-model="withdrawConfigFroms.start_time" valueFormat="HH:mm" format="HH:mm" />
          <span> - </span>
          <a-time-picker v-model="withdrawConfigFroms.end_time" valueFormat="HH:mm" format="HH:mm" />
        </a-form-model-item>
        <a-form-model-item label="app提现文字">
          <quills :contents.sync="withdrawConfigFroms.content"></quills>
        </a-form-model-item>
        <a-form-model-item  :wrapper-col="{ span: 21, offset:2 }">
          <a-button type="primary" style="width: 100%;" @click="whites">修改</a-button>
        </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import {getConfigCommon,writeConfigCommon } from '@/api/system.js'
export default {
  name: 'withdrawConfig',
  
  data() {
      return {
        withdrawConfigFroms:{
          bsf:"",
          content:"",
          end_time:"",
          fee:"",
          min:"",
          start_time:"",
        },
      }
  },
  created(){
    this.getPrivacyAgreementInfo()
  },
  methods:{
    getPrivacyAgreementInfo(){
      getConfigCommon({
        scene: 'sys_withdrawal',
        brand_id: process.env.VUE_APP_BRAND_ID,
        platform: ""
      }).then(res=>{
        this.withdrawConfigFroms=res.data
      })
    },
    whites(){
      writeConfigCommon({
        scene: 'sys_withdrawal',
        brand_id: process.env.VUE_APP_BRAND_ID,
        platform: "",
        ...this.withdrawConfigFroms
      }).then(res=>{
        this.$message.success("操作成功");
      })
    },
  }
}
</script>

<style lang="less" scoped>
.boxs{
  width: 800px;
  padding: 20px 30px;
}

</style>
